package com.qriver.cloud.provider;

import com.sun.istack.internal.logging.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 * 服务提供者
 */
@Controller
public class ProviderController {

    Logger logger = Logger.getLogger(ProviderController.class);

    @RequestMapping("/provider")
    @ResponseBody
    public String provider() {
        logger.info("调用服务提供者ProviderController的provider()方法！");
        return "Hello World!";
    }

    @RequestMapping("/unavailable")
    @ResponseBody
    public String unavailable() throws InterruptedException {
        logger.info("调用服务提供者ProviderController的unavailable()方法！");
        Thread.sleep(1000 * 10);
        return "Hello World!";
    }

}
